package com.chensf.studydemo.common

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import com.chensf.studydemo.R
import kotlinx.android.synthetic.main.fragment_record_demo.*

class RecordDemo : Fragment() {
    override fun onCreateView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        return inflater.inflate(R.layout.fragment_record_demo,container,false)
    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        audioRecord.listener = object :AudioRecordListener{
            override fun start() {
                testView.visibility = View.VISIBLE
            }

            override fun cancel() {
                testView.visibility = View.GONE
            }

            override fun complete() {
                testView.visibility = View.GONE
            }

        }
    }
}